package com.xl.web;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;

/**
 * Created with 徐立.
 *
 * @author 徐立
 * @date 2020-04-25
 * @time 20:50
 * To change this template use File | Settings | File Templates.
 */
@RestController
public class XLCookieAction {
    /**
     * /cookie/testCookies
     *
     * @param response
     * Result@return
     */
    @RequestMapping("/testCookies")
    public String setCookies(HttpServletResponse response) {
        //cookie值中文乱码
        Cookie cookies = new Cookie("user", "ceshiHello");
        response.addCookie(cookies);
        return "addCookies";
    }
}

